// Package sysin
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2025 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.16.10
package sysin

import (
	"context"
	"hotgo/internal/consts"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"
	"hotgo/utility/validate"

	"github.com/gogf/gf/v2/errors/gerror"
	"github.com/gogf/gf/v2/os/gtime"
)

// VideoOrderUpdateFields 修改订单管理字段过滤
type VideoOrderUpdateFields struct {
}

// VideoOrderInsertFields 新增订单管理字段过滤
type VideoOrderInsertFields struct {
}

// VideoOrderEditInp 修改/新增订单管理
type VideoOrderEditInp struct {
	entity.VideoOrder
}

func (in *VideoOrderEditInp) Filter(ctx context.Context) (err error) {

	return
}

type VideoOrderEditModel struct{}

// VideoOrderDeleteInp 删除订单管理
type VideoOrderDeleteInp struct {
	Id interface{} `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *VideoOrderDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type VideoOrderDeleteModel struct{}

// VideoOrderViewInp 获取指定订单管理信息
type VideoOrderViewInp struct {
	Id int `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *VideoOrderViewInp) Filter(ctx context.Context) (err error) {
	return
}

type VideoOrderViewModel struct {
	entity.VideoOrder
}

// VideoOrderListInp 获取订单管理列表
type VideoOrderListInp struct {
	form.PageReq
	OpenId        string `json:"openId"        dc:"openid"`
	OrderNum      string `json:"orderNum"      dc:"订单号"`
	Status        int    `json:"status"        dc:"状态"`
	ActivityTitle string `json:"activityTitle" dc:"活动名称"`
}

func (in *VideoOrderListInp) Filter(ctx context.Context) (err error) {
	return
}

type VideoOrderListModel struct {
	Id                int         `json:"id"                dc:"id"`
	OpenId            string      `json:"openId"            dc:"openid"`
	OrderNum          string      `json:"orderNum"          dc:"订单号"`
	ActivityId        int         `json:"activityId"        dc:"活动id"`
	VideoId           int         `json:"videoId"           dc:"视频id"`
	Price             float64     `json:"price"             dc:"金额"`
	CreateAt          *gtime.Time `json:"createAt"          dc:"添加时间"`
	UpdateAt          *gtime.Time `json:"updateAt"          dc:"更新时间"`
	Status            int         `json:"status"            dc:"状态"`
	ActivityTitle     string      `json:"activityTitle"     dc:"活动名称"`
	ActivityCoverImg  string      `json:"activityCoverImg"  dc:"封面图"`
	UserVideoVideoUrl string      `json:"userVideoVideoUrl" dc:"视频地址"`
	UserVideoPath     string      `json:"userVideoPath"     dc:"预览地址"`
}

// VideoOrderExportModel 导出订单管理
type VideoOrderExportModel struct {
	Id            int         `json:"id"            dc:"id"`
	OpenId        string      `json:"openId"        dc:"openid"`
	OrderNum      string      `json:"orderNum"      dc:"订单号"`
	ActivityId    int         `json:"activityId"    dc:"活动id"`
	VideoId       int         `json:"videoId"       dc:"视频id"`
	Price         float64     `json:"price"         dc:"金额"`
	CreateAt      *gtime.Time `json:"createAt"      dc:"添加时间"`
	UpdateAt      *gtime.Time `json:"updateAt"      dc:"更新时间"`
	Status        int         `json:"status"        dc:"状态"`
	ActivityTitle string      `json:"activityTitle" dc:"活动名称"`
}

// VideoOrderStatusInp 更新订单管理状态
type VideoOrderStatusInp struct {
	Id     int `json:"id" v:"required#id不能为空" dc:"id"`
	Status int `json:"status" dc:"状态"`
}

func (in *VideoOrderStatusInp) Filter(ctx context.Context) (err error) {
	if in.Id <= 0 {
		err = gerror.New("id不能为空")
		return
	}

	if in.Status <= 0 {
		err = gerror.New("状态不能为空")
		return
	}

	if !validate.InSlice(consts.StatusSlice, in.Status) {
		err = gerror.New("状态不正确")
		return
	}
	return
}

type VideoOrderStatusModel struct{}